﻿@using NavLink = FluentUI.Demo.Shared.NavLink

@switch (Value)
{
    case NavGroup group:
        <FluentNavGroup @bind-Expanded="@group.Expanded" Gap="@group.Gap" Icon="@group.Icon" >
            <TitleTemplate>
                <h3>@group.Title</h3></TitleTemplate>
            <ChildContent>
                @foreach(var item in group.Children)
                {
                    <DemoNavMenuItem Value="item" />
                }
            </ChildContent>
        </FluentNavGroup>
        break;
    case NavLink:
        <FluentNavLink Icon="@Value.Icon" Href="@Value.Href" Match="@Value.Match">
            @if (Value.Match is NavLinkMatch.All)
            {
                <h3>@(new MarkupString(Value.Title))</h3>
            }
            else
            {
                @(new MarkupString(Value.Title))
            }
        </FluentNavLink>
        break;
}

@code {
    [Parameter, EditorRequired]
    public required NavItem Value { get; set; }
}
